export class BeginPlugin {
  constructor(options: any) {
    console.log(`从webpack.config文件接收的参数 ${options.cuihe}`)
  }

  apply(compiler: any) {
    compiler.hooks.initialize.tap('123', (state: any) => {
      console.log('webpack initialize 的时候调用我');
    });

    compiler.hooks.shouldEmit.tap('123', (s: any) => {
      console.log('webpack shouldEmit 的时候调用我');
    });

    //挂载的是 done 事件
    compiler.hooks.done.tap('hello plugin', (state: any) => {
      console.log('webpack done 的时候调用我');
    });

    compiler.hooks.afterDone.tap('hello plugin', (state: any) => {
      console.log('webpack afterDone 的时候调用我');
    });
  }
}
